package com.example.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @Classname PropertiesUtils
 * @Description TODO
 * @Date 2023/4/26 15:33
 * @Created by XiongXiong
 * @Author: X.I.O
 */
public class PropertiesUtils {


    /**
     * 读取 properties 配置文件。
     * @param filePath 文件路径
     * @return Properties 对象
     * @throws IOException
     */
    public static Properties load(String filePath) throws IOException {
        InputStream fis =PropertiesUtils.class.getClassLoader().getResourceAsStream(filePath);
        Properties props = new Properties();
        props.load(fis);
        fis.close();
        return props;
    }

}
